home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 February / EnterCD 02_2004.iso / Gry / Arcade! Classic Arcade Pack 2.0 / Arcade.EXE / $PROGRAMFILES / Arcade! Classic Arcade Pack / pacman.swf / scripts / frame_10 / DoAction.as
Encoding:
Text File  |  2003-12-05  |  1.6 KB  |  56 lines

  1. stop();
  2. showScores = function()
  3. {
  4.    var i = 10;
  5.    while(i > 0)
  6.    {
  7.       var n = scoreboard_lv["name" + (page + i)];
  8.       var s = scoreboard_lv["score" + (page + i)];
  9.       var l_mc = this["line" + i + "_mc"];
  10.       l_mc.rank_txt.text = page + i + ".";
  11.       l_mc.name_txt.text = !n.length ? "..." : n.toUpperCase();
  12.       l_mc.score_txt.text = !s.length ? "..." : s.addCommas();
  13.       l_mc.rank_txt.textColor = l_mc.name_txt.textColor = l_mc.score_txt.textColor = !(game_so.data.playerName.length && n.toUpperCase() == game_so.data.playerName.toUpperCase()) ? 16777215 : 16777011;
  14.       l_mc._visible = true;
  15.       loading_mc._visible = false;
  16.       i--;
  17.    }
  18. };
  19. page = 0;
  20. maxScore = 100;
  21. scoreboard_lv = new LoadVars();
  22. if(score > 0 && game_so.data.playerName.length > 0)
  23. {
  24.    scoreboard_lv.score = score;
  25.    scoreboard_lv.name = game_so.data.playerName.toLowerCase();
  26. }
  27. scoreboard_lv.game = "pacman";
  28. scoreboard_lv.sendAndLoad("http://score.openwares.org/games_score_text.php",scoreboard_lv,"POST");
  29. scoreboard_lv.onLoad = function(success)
  30. {
  31.    if(success)
  32.    {
  33.       if(Boolean(scoreboard_lv.success))
  34.       {
  35.          next_btn._visible = true;
  36.          if(scoreboard_lv.maxScore.length > 0)
  37.          {
  38.             maxScore = Number(scoreboard_lv.maxScore);
  39.          }
  40.          showScores();
  41.       }
  42.       else
  43.       {
  44.          loading_mc.errorMsg = scoreboard_lv.errorMsg.toUpperCase();
  45.          loading_mc.gotoAndStop(2);
  46.       }
  47.    }
  48.    else
  49.    {
  50.       loading_mc.errorMsg = "COULD NOT ACCESS SCORES.";
  51.       loading_mc.gotoAndStop(2);
  52.    }
  53. };
  54. score = 0;
  55. next_btn._visible = last_btn._visible = false;
  56.